const express = require('express');
const router = express.Router();
const productController = require('../controllers/product');
const { verifyToken } = require('../middlewares/auth');
const upload = require('../middlewares/upload');

router.get('/categories', productController.getCategories);
router.get('/', productController.getProducts);
router.get('/:id', productController.getProductById);
router.post('/:id/image', verifyToken, upload.single('image'), productController.uploadProductImage);

module.exports = router;